
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;

public class ParserEasy {

	public static void parserEasy(String name) {
		String filename = name;
		try {
			FileReader fr = new FileReader (filename);
			Scanner scan = new Scanner(fr);
			ArrayList<String> word = new ArrayList<String>();
			while (scan.hasNext()) {
			       //System.out.println(scan.next());
			       word.add(scan.next());
			}
			
			show(word);
			fr.close();
			
		} catch (FileNotFoundException e) {
			e.printStackTrace(System.err);
			
		} catch (IOException e) {			
			e.printStackTrace(System.err);
		}

	}
	   public static void show(ArrayList<String> array){
	        System.out.println("Array : ");
	                for (int i = 0; i < array.size(); i++) {
	                System.out.println(i + " "+ array.get(i) + " ");
	                }
	            }
	
public static void main(String[] args){
	BufferedReader bis = new BufferedReader (new InputStreamReader (System.in));
	try {
		System.out.println("Please, enter the path to the file and press <Enter>:");
		String name = bis.readLine();
		ParserEasy.parserEasy(name);
		
	} catch (IOException e) {

        System.out.print("Exception" + e);

   }
}	

}

